package net.studou.verify;


public class CheckEquals implements CheckChain {

	private CheckChain nextChain;
	
	private String param1, param2;
	
	private String message;

	public CheckEquals(String param1, String param2, CheckChain nextChain, String message) {
		this.nextChain = nextChain;
		this.param1 = param1;
		this.param2 = param2;
		this.message = message;
	}

	public String check(String content) {
		if (!param1.equals(param2)) {
			return message;
		} else {
			if (nextChain != null) {
				return nextChain.check(content);
			} else {
				return null;
			}
		}
	}

}
